$(function () {
	var id = getQueryString("id");
	vm.getInfo(id);
	vm.bsnGoutongzhidao.mentorid = getQueryString("mentorid");
});

var vm = new Vue({
	el:'#mapp',
	data:{
		title: "编辑沟通信息",
		bsnGoutongzhidao: {}
	},
	methods: {
		saveOrUpdate: function (event) {
			if (StringUtils.isEmpty(vm.bsnGoutongzhidao.id)) return;
			var thisUrl = ajaxServerUrlG("bsngoutongzhidao/updateGoutong");
			$.ajax({
				type: "POST",
			    url: thisUrl,
                contentType: "application/json",
			    data: JSON.stringify(vm.bsnGoutongzhidao),
			    success: function(r){
			    	if(r.code === 0){
						alert('操作成功');
					}else{
						alert(r.msg);
					}
				}
			});
		},
		getInfo: function(id){
			if (StringUtils.isEmpty(id)) return;
			var thisUrl = ajaxServerUrlG("bsngoutongzhidao/info/" + id);
			$.get(thisUrl, function(r){
					if(r.code === 0){
                		vm.bsnGoutongzhidao = r.bsnGoutongzhidao;
					}else{
						alert(r.msg);
					} 
            });
		}
	}
});